package co.yixiang.retail.biz.product.controller;

import co.yixiang.common.core.enums.ShopCommonEnum;
import co.yixiang.common.log.annotation.Log;
import co.yixiang.common.mproot.dozer.service.IGenerator;
import co.yixiang.mall.common.category.domain.YxStoreCategory;
import co.yixiang.mall.common.product.domain.YxStoreProduct;
import co.yixiang.retail.biz.product.service.YxStoreCategoryService;

import co.yixiang.retail.biz.product.service.YxStoreProductService;
import co.yixiang.retail.common.domain.YxStoreOrder;
import co.yixiang.retail.common.domain.YxSystemStore;
import co.yixiang.retail.common.dto.YxStoreProductQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@Api(tags = "门店商品")
@RestController
@RequestMapping("stock")
public class YxStoreProductController {
    @Autowired
    private YxStoreProductService yxStoreProductService;

    //1 、门店列表 根据类型查询
    @Log("查询门店商品信息")
    @ApiOperation("查询门店商品信息")
    @GetMapping(value = "/queryGoods")
    public ResponseEntity<Object> queryGoods(YxStoreProductQueryCriteria criteria,Pageable pageable) {

        return new ResponseEntity<>(yxStoreProductService.queryGoods(criteria,pageable), HttpStatus.OK);
    }

    //1 、门店列表 根据类型查询
    @Log("查询商品信息")
    @ApiOperation("查询商品信息")
    @GetMapping(value = "/queryBYstore")
    public ResponseEntity<Object> queryBYstore(YxStoreProductQueryCriteria criteria, Pageable pageable) {
        return new ResponseEntity<>(yxStoreProductService.queryBystore(criteria,pageable), HttpStatus.OK);
    }

    @Log("查询门店信息")
    @ApiOperation("查询门店信息")
    @GetMapping(value = "/queryRetail")
    public ResponseEntity<Object> queryRetail(Integer id) {
        return new ResponseEntity<>(yxStoreProductService.queryRetail(id), HttpStatus.OK);
    }

    @Log("查询平台商品信息")
    @ApiOperation("查询平台商品信息")
    @GetMapping(value = "/queryByCebters")
    public ResponseEntity<Object> queryByCebters(YxStoreProductQueryCriteria criteria,Pageable pageable) {
        return new ResponseEntity<>(yxStoreProductService.queryByCebters(criteria,pageable), HttpStatus.OK);
    }




}
